From Andrew Kirmse (akirmse at google's mail) and to a lesser degree, myself.
gpspilot.o: gpspilot.c defs.h queue.h gbtypes.h coldsync/palm.h \
coldsync/pdb.h
gpsutil.o: gpsutil.c defs.h queue.h gbtypes.h magellan.h
-gpx.o: gpx.c defs.h queue.h gbtypes.h
+gpx.o: gpx.c defs.h queue.h gbtypes.h xmlgeneric.h
grtcirc.o: grtcirc.c defs.h queue.h gbtypes.h
hiketech.o: hiketech.c defs.h queue.h gbtypes.h xmlgeneric.h
holux.o: holux.c defs.h queue.h gbtypes.h holux.h
jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h
igc.o: igc.c defs.h queue.h gbtypes.h
internal_styles.o: internal_styles.c defs.h queue.h gbtypes.h
+kml.o: kml.c defs.h queue.h gbtypes.h xmlgeneric.h
lowranceusr.o: lowranceusr.c defs.h queue.h gbtypes.h
magnav.o: magnav.c defs.h queue.h gbtypes.h coldsync/palm.h \
coldsync/pdb.h
jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \
jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
- jeeps/gpsnmeaget.h
+ jeeps/gpsnmeaget.h jeeps/gpsusbint.h
jeeps/gpsrqst.o: jeeps/gpsrqst.c jeeps/gps.h defs.h queue.h gbtypes.h \
jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \
jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \
jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
- jeeps/gpsnmeaget.h
+ jeeps/gpsnmeaget.h jeeps/gpsusbint.h
jeeps/gpsserial.o: jeeps/gpsserial.c jeeps/gps.h defs.h queue.h gbtypes.h \
jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \
jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \
jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
- jeeps/gpsnmeaget.h
+ jeeps/gpsnmeaget.h jeeps/garminusb.h
jeeps/gpsusbread.o: jeeps/gpsusbread.c jeeps/gps.h defs.h queue.h \
gbtypes.h jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h \
jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \
jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h \
jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h \
- jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h
+ jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h \
+ jeeps/gpsusbint.h
jeeps/gpsusbsend.o: jeeps/gpsusbsend.c jeeps/gps.h defs.h queue.h \
gbtypes.h jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h \
jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \
jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h \
jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h \
- jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h
+ jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h \
+ jeeps/gpsusbint.h
jeeps/gpsusbstub.o: jeeps/gpsusbstub.c
jeeps/gpsutil.o: jeeps/gpsutil.c jeeps/gps.h defs.h queue.h gbtypes.h \
jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \
shapelib/shpopen.o: shapelib/shpopen.c shapelib/shapefil.h
internal_styles.c: mkstyle.sh style/README.style style/arc.style style/csv.style style/custom.style style/dna.style style/fugawi.style style/gpsdrive.style style/gpsman.style style/mapconverter.style style/mxf.style style/nima.style style/s_and_t.style style/saplus.style style/tabsep.style style/xmap.style style/xmapwpt.style
./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1)
+ ./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1)
unsigned char sec;
/* accuracy and precision information for use where applicable */
- char sat; /* ff if averaged or unknown */
+ unsigned char sat; /* ff if averaged or unknown */
pdb_16 pdop; /* pdop * 100 */
pdb_16 hdop;
pdb_16 vdop;
be_write16(&rec->year, 0xff);
}
- be_write32(&rec->longitude, wpt->longitude * 10000000.0);
- be_write32(&rec->latitude, wpt->latitude * 10000000.0);
+ be_write32(&rec->longitude, (unsigned int) (wpt->longitude * 10000000.0));
+ be_write32(&rec->latitude, (unsigned int) (wpt->latitude * 10000000.0));
if ( wpt->altitude == unknown_alt ) {
- be_write32(&rec->elevation, -100000000U);
+ be_write32(&rec->elevation, -100000000);
}
else {
- be_write32(&rec->elevation, wpt->altitude * 100.0);
+ be_write32(&rec->elevation, (unsigned int) (wpt->altitude * 100.0));
}
be_write16( &rec->pdop, 0xffff );
}
vdata += strlen( vdata ) + 1;
- opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec);
+ opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
the standalone waypoints.
*/
time_t now = 0;
- int short_length;
now = current_time();
write_xml_header(ofd);
* You may distribute this file under the terms of the Artistic
* License, as specified in the README file.
*
- * $Id: pdb.c,v 1.6 2004-04-16 16:47:51 parkrrrr Exp $
+ * $Id: pdb.c,v 1.7 2005-03-18 03:56:35 robertl Exp $
*/
/* XXX - The way zero-length records are handled is a bit of a kludge. They
* shouldn't normally exist, with the exception of expunged records. But,
* but doesn't have it prototyped. Systems with 64-bit file I/O but
* based on LP64 model (i.e. OS/X) _require_ the prototype for lseek.
*/
-#if !defined (__WIN32__)
+#if defined (__WIN32__)
+#include <io.h>
+#else
#include <unistd.h>
#endif
#include <stdlib.h>
wptr = header_buf;
memcpy(wptr, db->name, PDB_DBNAMELEN);
wptr += PDB_DBNAMELEN;
- put_uword(&wptr, (db->attributes & ~PDB_ATTR_OPEN));
+ put_uword(&wptr, (uword) (db->attributes & ~PDB_ATTR_OPEN));
/* Clear the 'open' flag before writing */
put_uword(&wptr, db->version);
put_udword(&wptr, db->ctime);
/* And return to where we were before */
lseek(fd, here, SEEK_SET);
- return eof - here;
+ return (uword) (eof - here);
}
/* pdb_LoadHeader
struct pdb *db)
{
int err;
- localID next_off; /* Offset of the next thing in the file
+ udword next_off; /* Offset of the next thing in the file
* after the AppInfo block */
- off_t offset; /* Offset into file, for checking */
+ udword offset; /* Offset into file, for checking */
/* Check to see if there even *is* an AppInfo block */
if (db->appinfo_offset == 0L)
* we've already passed the beginning of the AppInfo block, as
* given by its offset in the header.
*/
- offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */
+ offset = (udword) lseek(fd, 0L, SEEK_CUR); /* Find out where we are */
if (offset != db->appinfo_offset)
{
if (offset > db->appinfo_offset)
int err;
localID next_off; /* Offset of the next thing in the file
* after the sort block */
- off_t offset; /* Offset into file, for checking */
+ localID offset; /* Offset into file, for checking */
/* Check to see if there even *is* a sort block */
if (db->sortinfo_offset == 0L)
* we've already passed the beginning of the sort block, as given
* by its offset in the header.
*/
- offset = lseek(fd, 0L, SEEK_CUR); /* Find out where we are */
+ offset = (udword) lseek(fd, 0L, SEEK_CUR); /* Find out where we are */
if (offset != db->sortinfo_offset)
{
if (offset > db->sortinfo_offset)
i < db->numrecs;
i++, rsrc = rsrc->next)
{
- off_t offset; /* Current offset, for checking */
+ udword offset; /* Current offset, for checking */
udword next_off; /* Offset of next resource in file */
/* Sanity check: make sure we haven't stepped off the end
* whether we've already passed the beginning of the
* resource, as given by its offset in the resource index.
*/
- offset = lseek(fd, 0L, SEEK_CUR);
+ offset = (udword) lseek(fd, 0L, SEEK_CUR);
/* Find out where we are now */
if (offset != rsrc->offset)
{
/* Subtract this resource's index from that of the next
* thing, to get the size of this resource.
*/
- rsrc->data_len = next_off - rsrc->offset;
+ rsrc->data_len = (uword) (next_off - rsrc->offset);
/* Allocate space for this resource */
if ((rsrc->data = (ubyte *) malloc(rsrc->data_len)) == NULL)
i < db->numrecs;
i++, rec = rec->next)
{
- off_t offset; /* Current offset, for checking */
+ udword offset; /* Current offset, for checking */
localID next_off; /* Offset of next resource in file */
/* Sanity check: make sure we haven't stepped off the end
* whether we've already passed the beginning of the
* record, as given by its offset in the record index.
*/
- offset = lseek(fd, 0L, SEEK_CUR);
+ offset = (udword) lseek(fd, 0L, SEEK_CUR);
/* Find out where we are now */
if (offset != rec->offset)
{
/* Subtract this record's index from that of the next one,
* to get the size of this record.
*/
- rec->data_len = next_off - rec->offset;
+ rec->data_len = (uword) (next_off - rec->offset);
/* Allocate space for this record
* If there's a record with length zero, don't pass that to
* native format, convert them to Palm (big-endian) format, and write
* them to a ubyte string.
*
- * $Id: util.c,v 1.3 2004-01-18 01:24:41 robertl Exp $
+ * $Id: util.c,v 1.4 2005-03-18 03:56:35 robertl Exp $
*/
#include "config.h"
}
INLINE void
-put_ubyte(ubyte **buf, ubyte value)
+put_ubyte(ubyte **buf, const ubyte value)
{
**buf = value;
++(*buf);
}
INLINE void
-put_uword(ubyte **buf, uword value)
+put_uword(ubyte **buf, const uword value)
{
**buf = (value >> 8) & 0xff;
++(*buf);
}
INLINE void
-put_udword(ubyte **buf, udword value)
+put_udword(ubyte **buf, const udword value)
{
- **buf = (value >> 24) & 0xff;
+ **buf = (ubyte) ((value >> 24) & 0xff);
++(*buf);
- **buf = (value >> 16) & 0xff;
+ **buf = (ubyte) ((value >> 16) & 0xff);
++(*buf);
- **buf = (value >> 8) & 0xff;
+ **buf = (ubyte) ((value >> 8) & 0xff);
++(*buf);
- **buf = value & 0xff;
+ **buf = (ubyte) (value & 0xff);
++(*buf);
}
#if TIME
}
vdata += strlen( vdata ) + 1;
- opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec);
+ opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
extern char *xcsv_urlbase;
extern char *prefer_shortnames;
+extern const char *gs_get_container(geocache_container t);
+extern geocache_container gs_mktype(const char *t);
+extern geocache_container gs_mkcont(const char *t);
+extern const char *gs_get_cachetype(geocache_type t);
+
static double pathdist = 0;
static double oldlon = 999;
static double oldlat = 999;
} else
if (strcmp(fmp->key, "LAT_INT32DEG") == 0) {
/* latitude as a 32 bit integer offset */
- wpt->latitude = intdeg_to_dec(atof(s), 1);
+ wpt->latitude = intdeg_to_dec((int) atof(s), 1);
} else
if ( strcmp(fmp->key, "LAT_HUMAN_READABLE") == 0) {
human_to_dec( s, &wpt->latitude, &wpt->longitude, 1 );
} else
if (strcmp(fmp->key, "LON_INT32DEG") == 0) {
/* longitude as a 32 bit integer offset */
- wpt->longitude = intdeg_to_dec(atof(s), 0);
+ wpt->longitude = intdeg_to_dec((int) atof(s), 0);
} else
if ( strcmp(fmp->key, "LON_HUMAN_READABLE") == 0) {
human_to_dec( s, &wpt->latitude, &wpt->longitude, 2 );
}
static void
-xcsv_resetpathlen()
+xcsv_resetpathlen(const route_head *head)
{
pathdist = 0;
oldlat = 999;
# define snprintf _snprintf
#endif
+/* Turn off numeric conversion warning */
+#if __WIN32__
+#pragma warning(disable:4244)
+#endif
+
/*
* Common definitions. There should be no protocol or file-specific
* data in this file.
void waypt_init(void);
void route_init(void);
void waypt_disp(const waypoint *);
+void waypt_status_disp(int total_ct, int myct);
void fatal(const char *, ...)
#if __GNUC__
__attribute__ ((__format__ (__printf__, 1, 2)))
__attribute__ ((__format__ (__printf__, 1, 2)))
#endif
;
-ff_vecs_t *find_vec(char *, char **);
+ff_vecs_t *find_vec(char * const, char **);
void disp_vecs(void);
void exit_vecs(void);
void disp_formats(int version);
-void printposn(double c, int is_lat);
+void printposn(const double c, int is_lat);
-filter_vecs_t * find_filter_vec(char *, char **);
+filter_vecs_t * find_filter_vec(char * const, char **);
void free_filter_vec(filter_vecs_t *);
void disp_filters(int version);
void disp_filter_vecs(void);
{
waypoint *wpt_tmp;
route_head *track_head;
- int br;
gpl_point_t gp;
double alt_feet;
static FILE *file_in;
static FILE *file_out;
static void *mkshort_handle;
-static char *deficon = NULL;
+/* static char *deficon = NULL; */
#define MYNAME "EasyGPS"
i++;
waypt_status_disp(total_ct, i);
}
+ return 0;
}
static void
way->addr[0] = 0;
way->cross_road[0] = 0;
way->cross_road[0] = 0;
- way->dpth = 1.0e25;
+ way->dpth = 1.0e25f;
way->wpt_class = 0;
return way;
queue *elem, *tmp;
extern queue waypt_head;
GPS_PWay *way;
- extern int32 gps_save_id;
int icon;
way = xcalloc(n,sizeof(*way));
}
static void
-data_write()
+data_write(void)
{
if (poweroff) {
return;
*/
reclen = gcdb_add_to_rec(rec, NULL, 0, NULL);
- opdb_rec = new_Record(0, 2, ct++, reclen, (const ubyte *)rec);
+ opdb_rec = new_Record(0, 2, ct++, (uword) reclen, (const ubyte *)rec);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
fatal(MYNAME ": libpdb couldn't get record memory\n");
}
- opdb_rec = new_Record (0, 0, ct++, vlen+1, vdata);
+ opdb_rec = new_Record (0, 0, ct++, (uword) (vlen+1), vdata);
if (opdb_rec == NULL)
fatal(MYNAME ": libpdb couldn't create record\n");
/* Tracks */
static xg_callback gl_trk_s;
-static xg_callback gl_trk_ident;
+// static xg_callback gl_trk_ident;
static xg_callback gl_trk_pnt_s, gl_trk_pnt_e;
static xg_callback gl_trk_utc;
static xg_callback gl_trk_lat;
trk_head = route_head_alloc();
track_add_head(trk_head);
}
-
+#if 0
void gl_trk_ident(const char *args, const char **unused)
{
trk_head->rte_name = xstrdup(args);
}
+#endif
void gl_trk_pnt_s(const char *args, const char **unused)
{
le_write32(&rec->wpt.d103.lat, lat);
le_write32(&rec->wpt.d103.lon, lon);
- opdb_rec = new_Record(0, 0, ct++, vdata - (char *) rec, (const ubyte *) rec);
+ opdb_rec = new_Record(0, 0, ct++, (uword) (vdata - (char *) rec), (const ubyte *) rec);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
}
vdata += strlen( vdata ) + 1;
- opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec);
+ opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
};
geocache_type
-gs_mktype(char *t)
+gs_mktype(const char *t)
{
int i;
int sz = sizeof(gs_type_map) / sizeof(gs_type_map[0]);
}
geocache_container
-gs_mkcont(char *t)
+gs_mkcont(const char *t)
{
int i;
int sz = sizeof(gs_container_map) / sizeof(gs_container_map[0]);
static void
gpx_waypt_pr(const waypoint *waypointp)
{
- char *tmp_ent;
const char *oname;
char *odesc;
double utme, utmn;
char utmzc;
- lonint = abs(wpt->longitude);
- latint = abs(wpt->latitude);
+ lonint = abs((int) wpt->longitude);
+ latint = abs((int) wpt->latitude);
GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude,
&utme, &utmn, &utmz, &utmzc);
QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) {
wpt = (waypoint *) elem;
pres_alt = interpolate_alt(pres_track, wpt->creation_time + time_adj);
- wr_fix_record(wpt, pres_alt, wpt->altitude);
+ wr_fix_record(wpt, (int) pres_alt, (int) wpt->altitude);
}
} else {
if (pres_track) {
// Only the pressure altitude track was found so generate fix
// records from it alone.
QUEUE_FOR_EACH(&pres_track->waypoint_list, elem, tmp) {
- wr_fix_record((waypoint *) elem, ((waypoint *) elem)->altitude, unknown_alt);
+ wr_fix_record((waypoint *) elem, (int) ((waypoint *) elem)->altitude, (int) unknown_alt);
}
} else if (gnss_track) {
// Only the GNSS altitude track was found so generate fix
// records from it alone.
QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) {
- wr_fix_record((waypoint *) elem, unknown_alt, ((waypoint *) elem)->altitude);
+ wr_fix_record((waypoint *) elem, (int) unknown_alt, (int) ((waypoint *) elem)->altitude);
}
} else {
// No tracks found so nothing to do
extern char gps_save_string[GPS_ARB_LEN];
extern int gps_is_usb;
-
extern struct COMMANDDATA COMMAND_ID[2];
extern struct LINKDATA LINK_ID[3];
extern struct GPS_MODEL_PROTOCOL GPS_MP[];
extern char *gps_16_sym[];
-
#endif
#ifdef __cplusplus
#include <string.h>
#include <time.h>
#include <stdlib.h>
+#include <ctype.h>
#define XMIN(a,b) (a < b? a : b)
**
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)())
+int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)(int, GPS_PWay *))
{
static UC data[2];
int32 fd;
**
** @return [int32] success
************************************************************************/
-int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)())
+int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)(GPS_PWay *))
{
UC data[GPS_ARB_LEN];
int32 fd;
if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data, (short) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
for(i=0;i<n;++i)
{
if (cb) {
- if (cb(way[i]))
+ if (cb((GPS_PWay *) way[i])) /* BUGBUG Wrong level of indirection */
break;
}
}
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Wpt_Data,
- data,len);
+ data, (US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
(*way)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
- (*way)->dpth = (int32)GPS_Util_Get_Float(p);
+ (*way)->dpth = GPS_Util_Get_Float(p);
p+=sizeof(float);
- (*way)->dst = (int32)GPS_Util_Get_Float(p);
+ (*way)->dst = GPS_Util_Get_Float(p);
p+=sizeof(float);
for(i=0;i<2;++i) (*way)->state[i] = *p++;
(*way)->alt = GPS_Util_Get_Float(p);
p+=sizeof(float);
- (*way)->dpth = (int32)GPS_Util_Get_Float(p);
+ (*way)->dpth = GPS_Util_Get_Float(p);
p+=sizeof(float);
- (*way)->dst = (int32)GPS_Util_Get_Float(p);
+ (*way)->dst = GPS_Util_Get_Float(p);
p+=sizeof(float);
for(i=0;i<2;++i) (*way)->state[i] = *p++;
static void GPS_D100_Send(UC *data, GPS_PWay way, int32 *len)
{
UC *p;
- int32 i;
p = data;
static void GPS_D101_Send(UC *data, GPS_PWay way, int32 *len)
{
UC *p;
- int32 i;
p = data;
static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len)
{
UC *p;
- int32 i;
p = data;
GPS_Util_Put_Float(p,way->dst);
p+= sizeof(float);
- GPS_Util_Put_Short(p,way->smbl);
+ GPS_Util_Put_Short(p,(US) way->smbl);
*len = 64;
static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len)
{
UC *p;
- int32 i;
p = data;
p+=sizeof(int32);
copy_char_array(&p, way->cmnt, 40, UpperYes);
- *p++ = way->smbl;
- *p = way->dspl;
+ *p++ = (UC) way->smbl;
+ *p = (UC) way->dspl;
*len = 60;
static void GPS_D104_Send(UC *data, GPS_PWay way, int32 *len)
{
UC *p;
- int32 i;
p = data;
GPS_Util_Put_Float(p,way->dst);
p+= sizeof(float);
- GPS_Util_Put_Short(p,way->smbl);
+ GPS_Util_Put_Short(p, (int16) way->smbl);
p+=sizeof(int16);
*p = 3; /* display symbol with waypoint name */
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
p+=sizeof(int32);
- GPS_Util_Put_Short(p,way->smbl);
+ GPS_Util_Put_Short(p, (int16) way->smbl);
p+=sizeof(int16);
q = (UC *) way->wpt_ident;
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
p+=sizeof(int32);
- GPS_Util_Put_Short(p,way->smbl);
+ GPS_Util_Put_Short(p, (int16) way->smbl);
p+=sizeof(int16);
q = (UC *) way->wpt_ident;
static void GPS_D107_Send(UC *data, GPS_PWay way, int32 *len)
{
UC *p;
- int32 i;
p = data;
*p++ = way->colour;
*p++ = way->dspl;
*p++ = 0x60;
- GPS_Util_Put_Short(p,way->smbl);
+ GPS_Util_Put_Short(p,(US) way->smbl);
p+=sizeof(int16);
for(i=0;i<18;++i) *p++ = way->subclass[i];
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lat));
} else {
GPS_Warning("Unknown protoid in GPS_D109_Send.");
}
- GPS_Util_Put_Short(p,way->smbl);
+ GPS_Util_Put_Short(p,(US) way->smbl);
p+=sizeof(int16);
for(i=0;i<18;++i) *p++ = way->subclass[i];
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lat));
for(i=0;i<2;++i) *p++ = way->cc[i];
for(i=0;i<4;++i) *p++ = 0xff; /* D109 silliness for ETE */
if (protoid == 110) {
- float temp = 1.0e25;
+ float temp = 1.0e25f;
GPS_Util_Put_Float(p, temp);
p += 4;
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
p+=sizeof(int32);
- GPS_Util_Put_Short(p,way->alt);
+ GPS_Util_Put_Short(p,(US) way->alt);
p+=sizeof(int16);
copy_char_array(&p, way->city, 24, UpperYes);
copy_char_array(&p, way->city, 24, UpperYes);
copy_char_array(&p, way->state, 2, UpperYes);
- GPS_Util_Put_Short(p,way->alt);
+ GPS_Util_Put_Short(p,(US) way->alt);
p+=sizeof(int16);
for(i=0;i<2;++i) *p++ = way->cc[i];
copy_char_array(&p, way->city, 24, UpperYes);
copy_char_array(&p, way->state, 2, UpperYes);
- GPS_Util_Put_Short(p,way->alt);
+ GPS_Util_Put_Short(p,(US) way->alt);
p+=sizeof(int16);
for(i=0;i<2;++i) *p++ = way->cc[i];
copy_char_array(&p, way->city, 24, UpperYes);
copy_char_array(&p, way->state, 2, UpperYes);
- GPS_Util_Put_Short(p,way->alt);
+ GPS_Util_Put_Short(p,(US) way->alt);
p+=sizeof(int16);
for(i=0;i<2;++i) *p++ = way->cc[i];
copy_char_array(&p, way->city, 24, UpperYes);
copy_char_array(&p, way->state, 2, UpperYes);
- GPS_Util_Put_Short(p,way->alt);
+ GPS_Util_Put_Short(p,(US) way->alt);
p+=sizeof(int16);
for(i=0;i<2;++i) *p++ = way->cc[i];
if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data,(US) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
}
- GPS_Make_Packet(&tra, method, data,len);
+ GPS_Make_Packet(&tra, method, data,(US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data,(US) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
}
- GPS_Make_Packet(&tra, method, data,len);
+ GPS_Make_Packet(&tra, method, data,(US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
p = data;
- GPS_Util_Put_Short(p,way->rte_link_class);
+ GPS_Util_Put_Short(p,(US) way->rte_link_class);
p+=sizeof(int16);
for(i=0;i<18;++i) *p++ = way->rte_link_subclass[i];
if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data,(US) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
}
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Trk_Data,
- data,len);
+ data,(US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data,(US) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
}
- GPS_Make_Packet(&tra, method, data,len);
+ GPS_Make_Packet(&tra, method, data,(US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
void GPS_D311_Get(GPS_PTrack *trk, UC *s)
{
UC *p;
- UC *q;
short identifier;
p=s;
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data,(US) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
}
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Prx_Wpt_Data,
- data,len);
+ data,(US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
p = data;
- GPS_Util_Put_Short(p,way->idx);
+ GPS_Util_Put_Short(p,(US) way->idx);
p+=sizeof(int16);
for(i=0;i<6;++i) *p++ = way->ident[i];
GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
p+=sizeof(int32);
- GPS_Util_Put_Short(p,way->alt);
+ GPS_Util_Put_Short(p,(US) way->alt);
p+=sizeof(int16);
for(i=0;i<24;++i) *p++ = way->city[i];
return MEMORY_ERROR;
- GPS_Util_Put_Short(data,n);
+ GPS_Util_Put_Short(data,(US) n);
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
data,2);
if(!GPS_Write_Packet(fd,tra))
}
GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Almanac_Data,
- data,len);
+ data,(US) len);
if(!GPS_Write_Packet(fd,tra))
return gps_errno;
*p++ = ts->tm_mon+1;
*p++ = ts->tm_mday;
- GPS_Util_Put_Short(p,ts->tm_year+1900);
+ GPS_Util_Put_Short(p,(US) (ts->tm_year+1900));
p+=2;
- GPS_Util_Put_Short(p,ts->tm_hour);
+ GPS_Util_Put_Short(p,(US) ts->tm_hour);
p+=2;
*p++ = ts->tm_min;
** @return [int32] number of waypoint entries
************************************************************************/
-int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)())
+int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)(int, struct GPS_SWay **))
{
int32 ret=0;
** @return [int32] success
************************************************************************/
-int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)())
+int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)(struct GPS_SWay **))
{
int32 ret=0;
int32 GPS_Command_Get_Track(const char *port, GPS_PTrack **trk);
int32 GPS_Command_Send_Track(const char *port, GPS_PTrack *trk, int32 n);
-int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way,int (*cb)());
-int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)());
+int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way,int (*cb)(int, struct GPS_SWay **));
+int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)(struct GPS_SWay **));
int32 GPS_Command_Get_Proximity(const char *port, GPS_PWay **way);
int32 GPS_Command_Send_Proximity(const char *port, GPS_PWay *way, int32 n);
struct GPS_MODEL_PROTOCOL
{
- int32 id;
+ US id;
int32 link;
int32 command;
int32 wayptt;
** Boston, MA 02111-1307, USA.
********************************************************************/
#include "gps.h"
+#include "gpsusbint.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
time_t GPS_Time_Now(void);
int32 GPS_Packet_Read(int32 fd, GPS_PPacket *packet);
+int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet);
int32 GPS_Get_Ack(int32 fd, GPS_PPacket *tra, GPS_PPacket *rec);
int32 ajb(int32 fd);
** Boston, MA 02111-1307, USA.
********************************************************************/
#include "gps.h"
+#include "gpsusbint.h"
+
#include <stdio.h>
#include <errno.h>
+#include <ctype.h>
/* @func GPS_Make_Packet ***********************************************
(*packet)->dle = DLE;
(*packet)->edle = DLE;
(*packet)->etx = ETX;
- (*packet)->n = n;
+ (*packet)->n = (UC) n;
(*packet)->type = type;
(*packet)->bytes = 0;
** Boston, MA 02111-1307, USA.
********************************************************************/
#include "gps.h"
+#include "garminusb.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
return 0;
}
WriteFile (comport, obuf, size, &len, NULL);
- if (len != size) {
+ if (len != (DWORD) size) {
fatal ("Write error. Wrote %d of %d bytes.", len, size);
}
return len;
int32 GPS_Serial_On_NMEA(const char *port, int32 *fd);
int32 GPS_Serial_Read(int32 ignored, void *ibuf, int size);
int32 GPS_Serial_Write(int32 ignored, const void *obuf, int size);
+void GPS_Serial_Error(char *hdr);
#endif
#include <ctype.h>
#include "gps.h"
#include "garminusb.h"
+#include "gpsusbint.h"
int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet)
{
*/
(*packet)->type = le_read16(&pkt.gusb_pkt.pkt_id);
payload_size = le_read32(&pkt.gusb_pkt.datasz);
- (*packet)->n = payload_size;
+ (*packet)->n = (UC) payload_size;
memcpy((*packet)->data, &pkt.gusb_pkt.databuf, payload_size);
return payload_size;
}
#include <stdio.h>
#include <errno.h>
#include "garminusb.h"
+#include "gpsusbint.h"
void
GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n)
(*packet)->type = type;
memcpy((*packet)->data, data, n);
- (*packet)->n = n;
+ (*packet)->n = (UC) n;
return;
}
int32
GPS_Write_Packet_usb(int32 fd, GPS_PPacket packet)
{
- size_t ret, sz;
-
garmin_usb_packet gp = {0};
// }
}
- hdevinfo = SetupDiGetClassDevs( &GARMIN_GUID, NULL, NULL,
+ hdevinfo = SetupDiGetClassDevs( (GUID *) &GARMIN_GUID, NULL, NULL,
DIGCF_PRESENT|DIGCF_INTERFACEDEVICE);
if (hdevinfo == INVALID_HANDLE_VALUE) {
/* Get the device associated with this index. */
devinterface.cbSize = sizeof(SP_INTERFACE_DEVICE_DATA);
- if (!SetupDiEnumDeviceInterfaces(hdevinfo, NULL, &GARMIN_GUID,
+ if (!SetupDiEnumDeviceInterfaces(hdevinfo, NULL, (GUID *) &GARMIN_GUID,
0, &devinterface)) {
GPS_Serial_Error("SetupDiEnumDeviceInterfaces");
warning("Is the unit powered up and connected?");
usb_handle = INVALID_HANDLE_VALUE;
#endif
}
+ return 0;
}
int
gusb_cmd_get(garmin_usb_packet *ibuf, size_t sz)
{
DWORD rxed = GARMIN_USB_INTERRUPT_DATA_SIZE;
- unsigned char *buf = &ibuf->dbuf;
+ unsigned char *buf = (unsigned char *) &ibuf->dbuf;
int i;
int tsz=0;
unsigned char *obuf = buf;
fatal("ioctl");
}
buf += rxed;
- sz =- rxed;
+ sz -= rxed;
tsz += rxed;
if (rxed < GARMIN_USB_INTERRUPT_DATA_SIZE) {
break;
{
DWORD rsz;
size_t i;
- unsigned char *obuf = &opkt->dbuf;
+ unsigned char *obuf = (unsigned char *) &opkt->dbuf;
const char *m1, *m2;
/* The spec warns us about making writes an exact multiple
static char *
id_unit(void)
{
-static const char oid[12] = {20, 0, 0, 0, 0xfe, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned char oid[12] = {20, 0, 0, 0, 0xfe, 0, 0, 0, 0, 0, 0, 0};
/*
* Identify the unit before getting into all the protocol gunk.
* We get two packets back, but we discard the protocol array
static void
kml_waypt_pr(const waypoint *waypointp)
{
- char *odesc;
fputs(" <Placemark>\n", ofd);
// write_optional_xml_entity(ofd, "\t", "name", waypointp->shortname);
write_optional_xml_entity(ofd, "\t", "name", waypointp->description);
be_write32(&rec->longitude, si_round(wpt->longitude * 100000.0));
be_write32(&rec->latitude, si_round(wpt->latitude * 100000.0));
- be_write32(&rec->elevation, wpt->altitude);
+ be_write32(&rec->elevation, (unsigned int) (wpt->altitude));
rec->plot = 0;
rec->unknown3 = 'a';
vdata[1] = '\0';
vdata += 2;
- opdb_rec = new_Record (0, 0, ct++, vdata-(char *)rec, (const ubyte *)rec);
+ opdb_rec = new_Record (0, 0, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
return;
}
WriteFile (comport, obuf, size, &len, NULL);
- if (len != size) {
+ if ((int) len != size) {
fatal(MYNAME ":. Wrote %d of %d bytes.\n", len, size);
}
}
// for(pdb_rec = pdb->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next) {
for(pdb_rec=pdb_rec->next; pdb_rec; pdb_rec=pdb_rec->next) {
waypoint *wpt_tmp;
- char *vdata;
+ char *vdata = 0;
char *edata;
struct tm tm = {0};
static void
data_write(void)
{
- queue *elem, *tmp;
-
static char *appinfo =
"\0\x01"
"User\0\0\0\0\0\0\0\0\0\0\0\0"
my_fwrite8(&dbl, mapsend_file_out);
/* altitude */
- i = wpt->altitude;
+ i = (int) wpt->altitude;
my_fwrite4(&i, mapsend_file_out);
/* time */
static void
mps_fileHeader_w(FILE *mps_file, int mps_ver)
{
- char hdr[100];
+ unsigned char hdr[100];
int reclen;
strcpy (hdr, "MsRc");
static void
mps_mapsegment_r(FILE *mps_file, int mps_ver)
{
- char hdr[100];
int reclen;
/* At the moment we're not doing anything with map segments, but here's the template code as if we were
+ char hdr[100];
fread(&CDid, 4, 1, mps_file);
reclen = le_read32(&CDid);
static void
mps_mapsetname_r(FILE *mps_file, int mps_ver)
{
- char hdr[100];
int reclen;
/* At the moment we're not doing anything with mapsetnames, but here's the template code as if we were
+ char hdr[100];
mps_readstr(mps_file, hdr, sizeof(hdr));
char mapsetnamename[very large number?];
strcpy(mapsetnamename,hdr);
}
}
}
-
+#if 0
/*
* wrapper to include the mps_ver_out information
* This one always writes a waypoint. If it has been written before
{
waypoint *wptfound = NULL;
char *newName;
- unsigned int uniqueNum = 0;
/* Search for this waypoint in the ones already written */
wptfound = mps_find_wpt_q_by_name(&written_wpt_head, wpt->shortname);
mps_wpt_q_add(&written_wpt_head, wpt);
}
}
+#endif
/*
* read in from file a route record
int interlinkStepCount;
int thisInterlinkStep;
unsigned int mpsclass;
- int FFsRead;
- time_t dateTime = 0;
route_head *rte_head;
int rte_count;
{
unsigned int reclen;
unsigned int rte_datapoints;
- unsigned int colour = 0; /* unknown colour */
int rname_len;
char *rname;
char hdr[20];
fwrite(zbuf, 9, 1, mps_file);
}
else {
- unsigned char cbuf[8];
hdr[0] = 1;
fwrite(hdr, 1 , 1, mps_file);
unsigned char hdr[10];
int lat;
int lon;
- time_t t = rtewpt->creation_time;
char zbuf[20];
char ffbuf[20];
char *src;
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "expat" /I "..\coldsync" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D VERSION=\"1.2.1_beta01072004_msvc\" /YX /FD /c
+# ADD CPP /nologo /W3 /WX /GX /O2 /I "expat" /I "..\coldsync" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D VERSION=\"1.2.1_beta01072004_msvc\" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "expat" /I "..\coldsync" /D "WIN32" /D "__WIN32__" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D VERSION=\"1.2.1_beta01072004_msvc\" /FR /YX /FD /GZ /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /W3 /WX /Gm /GX /ZI /Od /I "expat" /I "..\coldsync" /D "WIN32" /D "__WIN32__" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D VERSION=\"1.2.1_beta01072004_msvc\" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
+ WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
+ AdditionalDependencies="setupapi.lib"
OutputFile=".\Release/GPSBabel.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
+ WarnAsError="TRUE"
SuppressStartupBanner="TRUE"
- DebugInformationFormat="4"
+ DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
}
static void
-nmea_write()
+nmea_write(void)
{
waypt_disp_all(nmea_wayptpr);
track_disp_all(NULL, NULL, nmea_trackpt_pr);
--recs;
}
- opdb_rec = new_Record (0, 0, 0, sizeof(struct doc_record0)+sizeof(short)*(ct-1), (const ubyte *)rec0);
+ opdb_rec = new_Record (0, 0, 0,
+ (uword) (sizeof(struct doc_record0)+sizeof(short)*(ct-1)), (const ubyte *)rec0);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create summary record\n");
compress( &buf );
- opdb_rec = new_Record (0, 0, ct++, buf.len, (const ubyte *)buf.data);
+ opdb_rec = new_Record (0, 0, ct++, (uword) buf.len, (const ubyte *)buf.data);
if (opdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
bm = xstrdup(bookmarktext);
create_bookmark(bm);
- lonint = abs(wpt->longitude);
- latint = abs(wpt->latitude);
+ lonint = abs((int) wpt->longitude);
+ latint = abs((int) wpt->latitude);
GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude,
&utme, &utmn, &utmz, &utmzc);
{
}
-void position_process()
+void position_process(void)
{
int i = waypt_count();
psit_getToken(FILE *psit_file, char *buf, size_t sz, psit_tokenSep_type delimType)
{
int c;
-char *buf2 = buf; /* MRCB debug */
*buf = 0;
int garmin_icon_num;
waypoint *thisWaypoint;
- double psit_altitude = unknown_alt;
- double psit_depth = unknown_alt;
if (strlen(psit_current_token) > 0) {
thisWaypoint = waypt_new();
psit_waypoint_w(FILE *psit_file, const waypoint *wpt)
{
int icon;
- char *src;
- const char *ident;
- int display = 1;
- int colour = 0; /* (unknown colour) black is 1, white is 16 */
+ const char *ident;
+ char *src = 0; /* BUGBUG Passed to mkshort */
fprintf(psit_file, "%11.6f,%11.6f,",
wpt->latitude,
int garmin_icon_num;
- time_t dateTime = 0;
route_head *rte_head;
unsigned int rte_count;
waypoint *thisWaypoint;
- double psit_altitude = unknown_alt;
- double psit_depth = unknown_alt;
psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL);
unsigned int trk_count;
waypoint *thisWaypoint;
- double psit_altitude = unknown_alt;
- double psit_depth = unknown_alt;
psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL);
if (strlen(psit_current_token) == 0) {
time_t t = wpt->creation_time;
struct tm *tmTime = gmtime(&t);
- double psit_altitude = wpt->altitude;
- double psit_proximity = unknown_alt;
- double psit_depth = unknown_alt;
-
fprintf(psit_file, "%11.6f,%11.6f,",
wpt->latitude,
wpt->longitude);
rec = (struct record *) xcalloc(sizeof(*rec),1);
- be_write32(&rec->longitude, (wpt->longitude +
- 180.0) * 1000000.0);
- be_write32(&rec->latitude, (90.0 - wpt->latitude) * 1000000.0);
+ be_write32(&rec->longitude, (unsigned int) ((wpt->longitude +
+ 180.0) * 1000000.0));
+ be_write32(&rec->latitude, (unsigned int) ((90.0 - wpt->latitude) * 1000000.0));
if ( wpt->shortname ) {
strncpy(rec->name, wpt->shortname, 32 );
rec->name[31] = '\0';
if (rec_index != 0) {
struct pdb_record* pdb_rec;
- pdb_rec = new_Record(0, 0, ct++, rec_index *
- sizeof(struct record), current_rec);
+ pdb_rec = new_Record(0, 0, ct++, (uword) (rec_index *
+ sizeof(struct record)), current_rec);
if (pdb_rec == NULL) {
fatal(MYNAME ": libpdb couldn't create record\n");
static void
my_rd_init(const char *fname)
{
- int i;
-
ihandle = SHPOpen(fname, "rb" );
if (ihandle == NULL) {
fatal(MYNAME ":Cannot open shp file %s for reading\n", fname);
queue *elem = NULL;
queue *tmp = NULL;
queue tmp_queue;
- waypoint *wpt_tmp;
unsigned int tmp_count;
if ( opt_push ) {
double utme, utmn;
char utmzc;
- lonint = abs(wpt->longitude);
- latint = abs(wpt->latitude);
+ lonint = abs((int) wpt->longitude);
+ latint = abs((int) wpt->latitude);
GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude,
&utme, &utmn, &utmz, &utmzc);
+# cvsps -u
cvsps $* | awk '
/^Date:/ {
logt = "";
time_t
current_time(void)
{
- static char *frozen;
-
if (getenv("GPSBABEL_FREEZE_TIME")) {
return 0;
}
{
char *returnstr, *sp;
char *lcstr, *lcp;
- int i;
sp = returnstr = xstrdup(in);
lcp = lcstr = xstrdup(in);
*/
#include "uuid.h"
-
-static unsigned char
-random()
-{
- if (getenv("GPSBABEL_FREEZE_TIME")) {
- static unsigned char blech = 0;
- return blech++;
- } else
- return ;
-}
-
+#include <stdlib.h>
void
uuid_generate(uuid_t uu)
vcf_disp(const waypoint *wpt)
{
int latint, lonint;
- char tbuf[1024];
- time_t tm = wpt->creation_time;
- long utmz;
- double utme, utmn;
- char utmzc;
- lonint = abs(wpt->longitude);
- latint = abs(wpt->latitude);
+ lonint = abs((int) wpt->longitude);
+ latint = abs((int) wpt->latitude);
fprintf(file_out, "BEGIN:VCARD\nVERSION:3.0\n");
fprintf(file_out, "N:%s;%s;;;\n", wpt->description,wpt->shortname);